<div>
	<h2 data-translate="milkbeeApp.sweepstake.home.title">Sweepstakes</h2>
	<jhi-alert></jhi-alert>
	<div class="container-fluid">
		<div class="row">
			<div class="col-xs-4 no-padding-left">
				<button class="btn btn-primary" ui-sref="sweepstake.new">
					<span class="glyphicon glyphicon-plus"></span> <span
						data-translate="milkbeeApp.sweepstake.home.createLabel">
						Create new Sweepstake </span>
				</button>
			</div>
		</div>
	</div>
	<br />
	<div class="table-responsive">
		<table class="jh-table table table-striped">
			<thead>
				<tr jh-sort="vm.predicate" ascending="vm.reverse"
					callback="vm.transition()">
					<th></th>
					<th jh-sort-by="name"><span
						data-translate="milkbeeApp.sweepstake.name">Name</span> <span
						class="glyphicon glyphicon-sort"></span></th>
					<th jh-sort-by="detail"><span
						data-translate="milkbeeApp.sweepstake.detail">Detail</span> <span
						class="glyphicon glyphicon-sort"></span></th>
					<th jh-sort-by="startAt"><span
						data-translate="milkbeeApp.sweepstake.startAt">Start At</span> <span
						class="glyphicon glyphicon-sort"></span></th>
					<th jh-sort-by="endAt"><span
						data-translate="milkbeeApp.sweepstake.endAt">End At</span> <span
						class="glyphicon glyphicon-sort"></span></th>
					<th jh-sort-by="createdAt"><span
						data-translate="milkbeeApp.sweepstake.createdAt">Created At</span>
						<span class="glyphicon glyphicon-sort"></span></th>
					<th></th>
				</tr>
			</thead>
			<tbody>
				<tr ng-repeat-start="sweepstake in vm.sweepstakes track by sweepstake.id">
					<td>{{sweepstake.name}}</td>
					<td>{{sweepstake.detail}}</td>
					<td>{{sweepstake.startAt | date:'medium'}}</td>
					<td>{{sweepstake.endAt | date:'medium'}}</td>
					<td>{{sweepstake.createdAt | date:'medium'}}</td>
					<td class="text-right">
						<div class="btn-group flex-btn-group-container">
							<button type="submit"
								ui-sref="sweepstake-add-ward({id:sweepstake.id})"
								class="btn btn-info btn-sm">
								<span class="glyphicon glyphicon-plus-sign"></span> <span
									class="hidden-xs hidden-sm"
									data-translate="entity.action.addward"></span>
							</button>

							<button type="submit"
								ui-sref="sweepstake.delete({id:sweepstake.id})"
								class="btn btn-danger btn-sm">
								<span class="glyphicon glyphicon-remove-circle"></span> <span
									class="hidden-xs hidden-sm"
									data-translate="entity.action.delete"></span>
							</button>
						</div>
					</td>
				</tr>
				<tr ng-repeat-end> 
					<td colspan="6"> 
						<div ng-repeat="award in sweepstake.awardExts">
							<span>
							{{award.name}}--{{award.detail}}--{{award.rank}}--{{award.quantum}}
							</span>
						</div>
					</td>
				</tr>
			</tbody>
		</table>
	</div>
	<div class="text-center">
		<jhi-item-count page="vm.page" total="vm.queryCount"
			items-per-page="vm.itemsPerPage"></jhi-item-count>
		<uib-pagination class="pagination-sm" total-items="vm.totalItems"
			items-per-page="vm.itemsPerPage" ng-model="vm.page"
			ng-change="vm.transition()"></uib-pagination>
	</div>
</div>
